package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingInformationMapper;
import com.ruoyi.teaching.domain.TeachingInformation;
import com.ruoyi.teaching.service.ITeachingInformationService;

/**
 * 聊天信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingInformationServiceImpl implements ITeachingInformationService 
{
    @Autowired
    private TeachingInformationMapper teachingInformationMapper;

    /**
     * 查询聊天信息
     * 
     * @param informationId 聊天信息主键
     * @return 聊天信息
     */
    @Override
    public TeachingInformation selectTeachingInformationByInformationId(Long informationId)
    {
        return teachingInformationMapper.selectTeachingInformationByInformationId(informationId);
    }

    /**
     * 查询聊天信息列表
     * 
     * @param teachingInformation 聊天信息
     * @return 聊天信息
     */
    @Override
    public List<TeachingInformation> selectTeachingInformationList(TeachingInformation teachingInformation)
    {
        return teachingInformationMapper.selectTeachingInformationList(teachingInformation);
    }

    /**
     * 新增聊天信息
     * 
     * @param teachingInformation 聊天信息
     * @return 结果
     */
    @Override
    public int insertTeachingInformation(TeachingInformation teachingInformation)
    {
        teachingInformation.setCreateTime(DateUtils.getNowDate());
        return teachingInformationMapper.insertTeachingInformation(teachingInformation);
    }

    /**
     * 修改聊天信息
     * 
     * @param teachingInformation 聊天信息
     * @return 结果
     */
    @Override
    public int updateTeachingInformation(TeachingInformation teachingInformation)
    {
        teachingInformation.setUpdateTime(DateUtils.getNowDate());
        return teachingInformationMapper.updateTeachingInformation(teachingInformation);
    }

    /**
     * 批量删除聊天信息
     * 
     * @param informationIds 需要删除的聊天信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingInformationByInformationIds(Long[] informationIds)
    {
        return teachingInformationMapper.deleteTeachingInformationByInformationIds(informationIds);
    }

    /**
     * 删除聊天信息信息
     * 
     * @param informationId 聊天信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingInformationByInformationId(Long informationId)
    {
        return teachingInformationMapper.deleteTeachingInformationByInformationId(informationId);
    }
}
